


Namespace Kardex
Public Class Proveedor



 Public Function Combo(ByVal vTodos As Boolean, Optional ByVal vmensaje As String = "Todos") As Entity.Kardex.ProveedorCol
dim objCol as  New entity.Kardex.ProveedorCol
dim obj as  New Data.Kardex.Proveedor
objCol = obj.Listar("", _
		-1, _
		"", _
		"", _
		-1)
 If vTodos Then
Dim ent As New Entity.Kardex.Proveedor( _ 
		-1, _
		vmensaje , _
		"", _
		-1)
objCol.AddPrimero(ent)
End If
Return objCol
End Function


'***************************


public Function Listar(ProveedorId as integer) as Entity.Kardex.Proveedor

dim objEnt as  New entity.Kardex.Proveedor
dim obj as  New Data.Kardex.Proveedor
return obj.Listar(ProveedorId)

End Function


'***************************



public Function Listar( _
		ProveedorId as Integer, _
		Nombre as String, _
		RUC as String, _
		Estado as Integer) _
as  Entity.Kardex.ProveedorCol

dim objCol as  New entity.Kardex.ProveedorCol
dim obj as  New Data.Kardex.Proveedor
return obj.listar("", _
		ProveedorId, _
		Nombre, _
		RUC, _
		Estado)

End Function


'***************************


public Function Grabar( _
		ProveedorId as Integer, _
		Nombre as String, _
		RUC as String, _
		Estado as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Kardex.Proveedor
 if ProveedorId=-1 then 
_codigo= obj.insert( "", _
		ProveedorId , _
		Nombre , _
		RUC , _
		Estado , _
 vUSuario )
else
_codigo= obj.update( "", _
		ProveedorId , _
		Nombre , _
		RUC , _
		Estado , _
 vUSuario )
end if 
return _codigo

End Function


'***************************


public Function Insertar( _
		ProveedorId as Integer, _
		Nombre as String, _
		RUC as String, _
		Estado as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Kardex.Proveedor
_codigo= obj.insert( "", _
		ProveedorId, _
		Nombre, _
		RUC, _
		Estado, _
 vUSuario )
return _codigo

End Function


'***************************


public Function Updatear( _
		ProveedorId as Integer, _
		Nombre as String, _
		RUC as String, _
		Estado as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Kardex.Proveedor
_codigo= obj.Update( "", _
		ProveedorId , _
		Nombre , _
		RUC , _
		Estado , _
 vUSuario )
return _codigo

End Function


'***************************


public Function ELiminar(  ProveedorId as integer,vusuario as integer ,optional vopcion as string="Delete") as integer
dim _codigo as integer =-1
dim obj as  New Data.Kardex.Proveedor
_codigo= obj.Eliminar( "vopcion", ProveedorId ,vusuario)
return _codigo

End Function

End Class



end namespace

